package com.iknow.xmpp.util;

import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smack.packet.Presence.Mode;
import org.jivesoftware.smack.packet.Presence.Type;

public final class Status
{
  public static final int CONTACT_STATUS_AVAILABLE = 500;
  public static final int CONTACT_STATUS_AVAILABLE_FOR_CHAT = 600;
  public static final int CONTACT_STATUS_AWAY = 300;
  public static final int CONTACT_STATUS_BUSY = 400;
  public static final int CONTACT_STATUS_DISCONNECT = 100;
  public static final int CONTACT_STATUS_UNAVAILABLE = 200;

  public static Presence.Mode getPresenceModeFromStatus(int paramInt)
  {
    Presence.Mode localMode;
    Object localObject;
    switch (paramInt)
    {
    default:
      localObject = null;
      return localObject;
    case 500:
      localMode = Presence.Mode.available;
    case 600:
    case 300:
    case 400:
    case 200:
    }
    while (true)
    {
      while (true)
      {
        while (true)
        {
          while (true)
          {
            while (true)
              localObject = localMode;
            localMode = Presence.Mode.chat;
          }
          localMode = Presence.Mode.away;
        }
        localMode = Presence.Mode.dnd;
      }
      localMode = Presence.Mode.xa;
    }
  }

  public static int getStatusFromPresence(Presence paramPresence)
  {
    int i;
    if (paramPresence.getType().equals(Presence.Type.unavailable))
      i = 100;
    while (true)
    {
      while (true)
      {
        while (true)
        {
          while (true)
          {
            while (true)
            {
              while (true)
              {
                Presence.Mode localMode;
                while (true)
                {
                  return i;
                  localMode = paramPresence.getMode();
                  if (localMode != null)
                    break;
                  i = 500;
                }
                switch ($SWITCH_TABLE$org$jivesoftware$smack$packet$Presence$Mode()[localMode.ordinal()])
                {
                default:
                  i = 100;
                case 2:
                case 3:
                case 1:
                case 5:
                case 4:
                }
              }
              i = 500;
            }
            i = 300;
          }
          i = 600;
        }
        i = 400;
      }
      i = 200;
    }
  }

  public static boolean statusOnline(int paramInt)
  {
    int i;
    if (paramInt != 100)
      i = 1;
    while (true)
    {
      return i;
      i = 0;
    }
  }
}